﻿<phone:PhoneApplicationPage 
    x:Class="MyMeetup.PhotoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" shell:SystemTray.Opacity="0"
    OrientationChanged="PhoneApplicationPage_OrientationChanged"
    DataContext="{Binding PhotoPageViewModel, Source={StaticResource Locator}}">
   

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition />
        </Grid.RowDefinitions>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="0">
            <!--<ScrollViewer>
                <toolkit:GestureService.GestureListener>
                    <toolkit:GestureListener Flick="OnFlick"/>
                </toolkit:GestureService.GestureListener>
                <Image Stretch="Uniform"  Name="currentImage" VerticalAlignment="Center" HorizontalAlignment="Center" />
            </ScrollViewer>-->
            <controls:Pivot Name="photoPivot" ItemsSource="{Binding CurrentPhotos}" >
                <controls:Pivot.HeaderTemplate>
                    <DataTemplate>
                        <Grid />
                    </DataTemplate>
                </controls:Pivot.HeaderTemplate>
                <controls:Pivot.ItemTemplate>
                    <DataTemplate>
                        <Image Name="displayImage" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="{Binding photo_link}" RenderTransformOrigin="0.5, 0.5" CacheMode="BitmapCache">
                            <Image.RenderTransform>
                                <CompositeTransform x:Name="transform" />
                            </Image.RenderTransform>
                            <toolkit:GestureService.GestureListener>
                                <toolkit:GestureListener PinchDelta="OnPinchDelta" PinchStarted="OnPinchStarted" DragDelta="OnDragDelta" />
                            </toolkit:GestureService.GestureListener>
                        </Image>
                    </DataTemplate>
                </controls:Pivot.ItemTemplate>
                <controls:Pivot.ItemContainerStyle>
                    <Style TargetType="controls:PivotItem">
                        <Setter Property="Margin" Value="0"/>
                        <Setter Property="Padding" Value="0"/>                        
                    </Style>
                </controls:Pivot.ItemContainerStyle>
            </controls:Pivot>
            <toolkit:PerformanceProgressBar Name="progressBar" VerticalAlignment="top"/>
        </Grid>
    </Grid>
    
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.save.rest.png" Text="save" Click="SavePhoto"/>
            <!--<shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>-->
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
